package com.ruoyi.system.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TVipMapper;
import com.ruoyi.system.domain.TVip;
import com.ruoyi.system.service.ITVipService;

/**
 * vip权益Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-04-24
 */
@Service
public class TVipServiceImpl extends ServiceImpl<TVipMapper, TVip> implements ITVipService
{
    @Autowired
    private TVipMapper tVipMapper;

    /**
     * 查询vip权益
     * 
     * @param id vip权益主键
     * @return vip权益
     */
    @Override
    public TVip selectTVipById(Long id)
    {
        return tVipMapper.selectTVipById(id);
    }

    /**
     * 查询vip权益列表
     * 
     * @param tVip vip权益
     * @return vip权益
     */
    @Override
    public List<TVip> selectTVipList(TVip tVip)
    {
        return tVipMapper.selectTVipList(tVip);
    }

    /**
     * 新增vip权益
     * 
     * @param tVip vip权益
     * @return 结果
     */
    @Override
    public int insertTVip(TVip tVip)
    {
        tVip.setCreateTime(DateUtils.getNowDate());
        return tVipMapper.insertTVip(tVip);
    }

    /**
     * 修改vip权益
     * 
     * @param tVip vip权益
     * @return 结果
     */
    @Override
    public int updateTVip(TVip tVip)
    {
        tVip.setUpdateTime(DateUtils.getNowDate());
        return tVipMapper.updateTVip(tVip);
    }

    /**
     * 批量删除vip权益
     * 
     * @param ids 需要删除的vip权益主键
     * @return 结果
     */
    @Override
    public int deleteTVipByIds(Long[] ids)
    {
        return tVipMapper.deleteTVipByIds(ids);
    }

    /**
     * 删除vip权益信息
     * 
     * @param id vip权益主键
     * @return 结果
     */
    @Override
    public int deleteTVipById(Long id)
    {
        return tVipMapper.deleteTVipById(id);
    }
}
